#include "renderthread.h"

RenderThread::RenderThread(QObject *parent)
	: QThread(parent),_viewerPtr(0)
{
	
}

RenderThread::~RenderThread()
{
	if (_viewerPtr) 
		_viewerPtr->setDone(true); 

	wait();
}

void RenderThread::run()
{
	if (_viewerPtr) 
		_viewerPtr->frame();
}

void RenderThread::setViewer(osgViewer::Viewer* view)
{
	_viewerPtr = view;
}